export function debounce( fun, time){
  let timer = null;
  return ()=>{
    clearTimeout(timer);
    timer = setTimeout(()=>{
      fun()
    },time)
  }
}